<%--
  Created by IntelliJ IDEA.
  User: 1
  Date: 2022/1/13
  Time: 8:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.js"></script>
</head>
<body>
<div class="container" id="div1">
    <caption>
        <div style="float: right;margin-bottom: 5px">
        </div>
    </caption>
    <table id="table" class="table table-hover">

    </table>
    <script>
        $(function () {
            $("#table").bootstrapTable({
                method:"get",
                contentType:"application/json",
                url:"http://localhost:8080/ck/queryCkd",
                striped:true,
                pageNumber:1,
                pagination:true,
                sidePagination:"server",
                pageSize:5,
                pageList:[3,5,7,10],
                queryParams:function (param) {
                    return {
                        page: (param.offset / param.limit) + 1,
                        pageNum: param.limit,
                        checkTag:"S001-0",
                    }
                },
                columns:[
                    {title:"出库单编号",field:"payId",align:"center"},
                    {title:"出库理由",field:"reason",align:"center"},
                    {title:"审核标志",field:"checkTag",align:"center"},
                    {title:"操作",field:"id",align:"center",formatter:function (value,row) {
                            var btn1="<button class='btn btn-primary btn-sm' data-toggle='modal' data-target='#myModal' onclick=update('"+row.payId+"','"+row.amountSum+"','"+row.costPriceSum+"')>审核</button>";
                            return btn1
                        }}
                ]
            })
        })
    </script>
</div>

<DIV class=DIV_STYLE2 style="display: none" id="div2"><TABLE cellSpacing=0 cellPadding=0 width=1000 align=center bgColor=#ffffff border=0 >
    <div style="position: relative;left: 60%">

        <INPUT   onclick="shtg('sb')" data-toggle="modal" data-target="#myModal"  type=button value=审核不通过>
        <INPUT  onclick="shtg('tg')" type=button value=审核通过>
        <INPUT   onclick="yl()" type=button value=退出>
        <INPUT onmouseup="this.className='btn3_mouseup'" onclick=fanhui() onmouseover="this.className='btn3_mouseover'" onmousedown="this.className='btn3_mousedown'" onmouseout="this.className='btn3_mouseout'" class=btn3_mouseout type=button value=返回>
    </div>
    <TBODY>
    <TR>
        <TD class=TABLE_STYLE6 vAlign=bottom rowSpan=2 align=center>
            <TABLE style="BORDER-TOP: #333333 1px solid; BORDER-RIGHT: #333333 1px solid; BORDER-BOTTOM: #333333 1px solid; BORDER-LEFT: #333333 1px solid" cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                <TR>
                    <TD height=10 colSpan=4>
                        <TABLE width="100%">
                            <TBODY>
                            <TR>
                                <TD>
                                    <table align="center">
                                        <tr>
                                            <td><h3>出库申请单</h3></td>
                                        </tr>
                                    </table>
                                    <br>
                                    <div>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span >出库人:<span><input type="text" style="border-bottom: 1px solid #000000;border-left: 0px;border-top: 0px;border-right: 0px;width: 40%;outline:none"></span></span>
                                        <span style="position: relative;left:50px;">出库理由: <select name="" id="rkly">
                                           <option value="C002-1">生产领料</option>
                                         <option value="C002-2">赠送</option>
                                         <option value="C002-3">内部借领</option>
                                         <option value="C002-4">其他借领</option>
                                     </select></span>
                                        <br>
                                    </div>
                                    <br>
                                    <TABLE id=tableOnlineEdit class=TABLE_STYLE5 borderColor=#000000 cellSpacing=0 cols=1 borderColorDark=#eeeeee cellPadding=0 align=center borderColorLight=#848284 border=1><THEAD>

                                    </THEAD>
                                        <TBODY></TBODY>
                                    </TABLE>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span>总件数:
                                         <span><input type="text" style="border-bottom: 1px solid #000000;border-left: 0px;border-top: 0px;border-right: 0px;width: 40%;outline:none" id="sum"></span></span>
                                    <span style="position: relative;left:50px;">总金额:<span><input type="text" style="border-bottom: 1px solid #000000;border-left: 0px;border-top: 0px;border-right: 0px;width: 40%;outline:none" id="je"></span></span>
                                    <br>
                                    <br>

                                    <div>
                                        <div>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <span style="position: relative;top: -40px">备注:</span><textarea style="resize: none" rows=4 cols="100" ></textarea>
                                        </div>
                                    </div>
                                </TD></TR></TBODY></TABLE></TD></TR>
                <TR>
                    <TD width=56 colSpan=3 noWrap></TD></TR>
                <TR>
                    <TD height=100 colSpan=3 noWrap></TD>
                    <TD></TD></TR>
                <TR vAlign=bottom>
                    <TD colSpan=4 noWrap align=center></TD></TR></TD>
                <TR>
                    <TD colSpan=4 noWrap align=right></TD></TR></TBODY></TABLE></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD></TR>
    <TR>
        <TD bgColor=#333333 height=120 width=1></TD>
        <TD bgColor=#666666 height=120 width=1></TD>
        <TD bgColor=#999999 height=120 width=1></TD></TR>
    <TR align=right vAlign=top>
        <TD colSpan=4>
            <TABLE class=TABLE_STYLE6 cellSpacing=0 cellPadding=0 align=center border=0>
                <TBODY>
                <TR>
                    <TD bgColor=#333333 height=1></TD></TR>
                <TR>
                    <TD bgColor=#666666 height=1></TD></TR>
                <TR>
                    <TD bgColor=#999999 height=1></TD></TR></TBODY></TABLE></TD></TR>
    <TR align=right vAlign=middle>
        <TD colSpan=4></TD></TR></TBODY></TABLE></DIV>

<script>
    let id;
    function update(aa,bb,cc){
        document.getElementById("div1").style.display="none";
        document.getElementById("div2").style.display="block";
        id=aa;
        $("#sum").val(bb);
        $("#je").val(cc);
        $("#tableOnlineEdit").bootstrapTable({
            method:"get",
            contentType:"application/json",
            url:"http://localhost:8080/ck/queryCks",
            striped:true,
            pageNumber:1,
            pagination:true,
            sidePagination:"server",
            pageSize:5,
            pageList:[3,5,7,10],
            queryParams:function (param) {
                return {
                    page: (param.offset / param.limit) + 1,
                    pageNum: param.limit,
                    parentId:aa
                }
            },
            columns:[
                {title:"产品编号",field:"productId",align:"center"},
                {title:"产品名称",field:"productName",align:"center"},
                {title:"数量",field:"amount",align:"center"},
                {title:"成本单价",field:"costPrice",align:"center"},
                {title:"小计",field:"subtotal",align:"center"},
            ]
        })
    }
    function shtg(ss) {
        if(ss=='tg'){
            var checkTag="S001-1";
        }else {
            var checkTag="S001-2";
        }
        $.getJSON("http://localhost:8080/ck/cksh",{checkTag:checkTag,payId:id},function (data) {
            window.location="/wp/ckaash.jsp";
        })
    }
</script>
</body>
</html>
